﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BloomsburyBanHang.DAO;
namespace BloomsburyBanHang
{
    public partial class detail1 : System.Web.UI.Page
    {
        public string chuoiND;
        public SAN_PHAM sp = new SAN_PHAM();
        public string TacGia = "";
        public string NXB = "";
        protected void Page_Load(object sender, EventArgs e)
        {
            chuoiND = "";
            string maSP = Request.QueryString["MaSanPham"];
            sp = SanPhamDAO.TimSanPhamTheoMa(Convert.ToInt32(maSP));
            TacGia = TacGiaDAO.TimTacGiaTheoMa(sp.MaTacGia).TenTacGia;
            NXB = NhaXuatBanDAO.TimNXBTheoMa(sp.MaNhaXuatBan).TenNhaXuatBan;
            //chuoiND+="<div id='fiche_product'>";
            chuoiND += "    <div id='pb-left'>";
            chuoiND += "        <div id='img-main'>";
            chuoiND += "            <img class='img active'src='" + sp.HinhAnh + "'/>";
            chuoiND += "        </div>";
            chuoiND += "        <ul id='list-img'>";
            chuoiND += "            <li><img src='" + sp.HinhAnh + "'/></li>";

            string[] images = sp.MoRong.Split(',');
            foreach (string img in images)
            {
                chuoiND += "<li><img src='" + img + "'/></li>";
            }

            chuoiND += "        </ul>";
            chuoiND += "</div><!-- pb-left -->";
        }
    }
}